package file;

import java.io.File;

public class FileDelete {
    public static void main(String[] args) {

        /**
         * 文件和文件夹的删除
         */
        //获取文件
        File dir = new File("D://Jack");
        File dir2 = new File("D://Jack//liuhe");
        //删除文件夹(内容为空才能删除成功,否则删除失败)
        boolean delete = dir.delete();
        boolean delete2 = dir2.delete();
        System.out.println(delete);
        System.out.println(delete2);
        //删除文件是直接进行删除不经过回收站的
        File file = new File("D:\\software\\hello.txt");
        boolean fileDelete = file.delete();
        System.out.println(fileDelete);

    }
}
